package com.tencent.wxcloudrun.vo.request.user;

import java.time.LocalDateTime;
import java.util.Date;

import com.tencent.wxcloudrun.domain.TUser;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * @Author ZhaoZiYin
 * @Date 2025/4/22
 * @Description 用户更新请求入参
 */
@Data
@ApiModel(value = "UserUpdateReqVo", description = "用户更新请求入参")
public class UserUpdateReqVo {

    @NotNull
    @ApiModelProperty("用户ID")
    private Long userId;

    @ApiModelProperty("用户名称")
    private String name;

    @ApiModelProperty("用户头像")
    private String avatar;

    @ApiModelProperty("用户手机号")
    private String phone;

    public void build(TUser user) {
        user.setName(name);
        user.setAvatar(avatar);
        user.setPhone(phone);
        user.setUpdatedBy(String.valueOf(userId));
        user.setUpdatedTime(LocalDateTime.now());
    }

}
